package util;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

public class Config {

	private static Logger log = LogManager.getLogger(Config.class);

	private static Properties prop =  null;
	public static final String dbip = load().getProperty("dbip","");
	public static final String dbname = load().getProperty("dbname","");
	public static final String uid = load().getProperty("uid","");
	public static final String pwd = load().getProperty("pwd","");
	public static final String receiver = load().getProperty("receiver","");
	public static final String sender = load().getProperty("sender","");
	public static final String stats_date = load().getProperty("stats_date","");

	/**
     * ���������ļ�
     * @return
     */
    private static final Properties load() {

    		try {
    			if(prop==null){
    				prop=new Properties();
    				prop.load(new FileInputStream(new File("D:\\workspace\\sms\\smscard\\StatEachDay\\cfg\\config.properties")));
    			}
    		} catch (IOException e) {
    			log.error("�����ļ�����ʧ�ܣ����飡");
    			e.printStackTrace();
    		}
		return prop;
    }
}
